import Http from "../utils/Http";

export default class ProductModel extends Http {

  // area
  getArea(data) {
    return this.request({
      url: '/h5/area/list',
      data
    })
  }

  // category
  getCategory(data) {
    return this.request({
      url: '/h5/category/product-by-category',
      data
    })
  }

  // brand
  getBrand(data) {
    return this.request({
      url: '/h5/brand/list',
      data
    })
  }

  getBrandView(data) {
    return this.request({
      url: '/h5/brand/view',
      data
    })
  }

  // all product
  getAllProduct(data) {
    return this.request({
      url: '/h5/product/list',
      data
    })
  }

  // detail
  getDetail(data) {
    return this.request({
      url: '/h5/product/detail',
      data
    })
  }

  // 显示复购价
  displayRepeat(data) {
    return this.request({
      url: '/h5/product/display-repeat-price',
      data
    })
  }

  /* product fav */
  checkFav(data) {
    return this.request({
      url: '/h5/execute/fav/check',
      data
    })
  }

  createFav(data) {
    return this.request({
      url: '/h5/execute/fav/create',
      data
    })
  }

  removeFav(data) {
    return this.request({
      url: '/h5/execute/fav/delete',
      data
    })
  }

  favList(data) {
    return this.request({
      url: '/h5/execute/fav/list',
      data
    })
  }

}
